package com.chance.cc.crawler.development.command.publish.sina;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.module.SinaMedRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.module.SinaMedTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.module.SinaMpRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.module.SinaMpTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.searchKw.SinaSearchKwRealtimeCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.sina.searchKw.SinaSearchKwTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.domain.sina.SinaScheduleTrigger;

/**
 * @Author Zhao.Hhuan
 * @Date Create in 2021/1/18 14:15
 * @Description
 *      新浪
 **/
public class SinaPublishCrawlerJob {
    private static String domain = "sina";

    public static void main(String[] args) {

//        publishSimpleJob();

//        publishMedRealtimeJob();
//        publishMedTraceJob();

//        publishSearchKwRealtimeJob();
//        publishSearchKwTraceJob();

        publishMpRealtimeJob();
//        publishMpTraceJob();
//        SinaCrawlerScript.publishCrawlerNodeScript();
    }

    public static void publishSimpleJob(){
        CrawlerJob crawlerJob = SinaSearchKwRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        SinaScheduleTrigger.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    public static void publishMedRealtimeJob(){
        CrawlerJob crawlerJob = SinaMedRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        SinaScheduleTrigger.realtimeCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }


    public static void publishMedTraceJob(){
        CrawlerJob crawlerJob = SinaMedTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        SinaScheduleTrigger.traceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    private static void publishSearchKwRealtimeJob(){
        CrawlerJob crawlerJob = SinaSearchKwRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        SinaScheduleTrigger.realtimeCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    private static void publishSearchKwTraceJob(){
        CrawlerJob crawlerJob = SinaSearchKwTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        SinaScheduleTrigger.traceCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    private static void publishMpRealtimeJob(){
        CrawlerJob crawlerJob = SinaMpRealtimeCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        SinaScheduleTrigger.simpleCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    private static void publishMpTraceJob(){
        CrawlerJob crawlerJob = SinaMpTraceCrawlerSchedulerJob.publishCrawlerScheduleJobInfo();
        SinaScheduleTrigger.traceMpCrawlerScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }


}
